﻿@{
    ViewBag.Title = "Свойства продуктов";
}
@section style
{
    <link rel="stylesheet" href="~/static/plugins/jui/css/ui-lightness/jquery-ui-1.10.3.custom.min.css">
    <link rel="stylesheet" href="~/static/plugins/jtable/themes/lightcolor/blue/jtable.min.css">
}
@section script_bottom
{
    <script type="text/javascript" src="~/static/plugins/jui/js/jquery-ui-1.10.3.custom.min.js"></script>
    <script type="text/javascript" src="~/static/plugins/jtable/jquery.jtable.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function() {
            $('#TableContainer').jtable({
                title: 'Свойства продуктов',
                actions: {
                    listAction: '@Url.Action("ListProperty")',
                    createAction: '@Url.Action("AddProperty")',
                    updateAction: '@Url.Action("UpdateProprty")',
                    deleteAction: '@Url.Action("RemoveProperty")'
                },
                fields: {
                    Id: {
                        key: true,
                        list: false
                    },
                    /*ASd: {
                        title: "",
                        edit: false,
                        create: false,
                        width: "0%",
                        display: function (data) {
                            return '<a href="http://ya.ru/'+data.record.Id+'"' +
                                'style="display:block;" title="Edit Record" class="jtable-command-button jtable-edit-command-button"><span>Edit Record</span></a>';
                        }
                    },*/
                    Name: {
                        title: 'Имя',
                        width: "95%"
                    }
                    
                }
            });
            $('#TableContainer').jtable('load');
        });
    </script>
}

<h2>Свойства продуктов</h2>
<div id="TableContainer"></div>